const crypto = require('crypto');
 
module.exports = () => {
    return async (ctx, next) => {
        try {
            await next();
        } catch (err) {
            ctx.logger.error(err);
            ctx.status = 400;
            ctx.body = {
                message: err.message
            }
        }
    }
}